<template>
  <div class="selfdom">
    <div class="selfdomTao">
      <div class="self">
        <div class="v-hd2">
          <div class="yuanquan"></div>
          <span
            class="tit f-ff2 f-tdn"
            style="cursor: pointer;"
          >个性化推荐</span>
        </div>
        <div class="self-main">
          <div
            class="dieSJ"
            style="width:140px;height:235px;background:#fff;float:left"
          >
            <a
              href="javascript:;"
              class="zhengti"
            >
              <span class="head">星期{{dateDay}}</span>
              <span class="bd">{{date}}</span>
              <span class="wu"></span>
            </a>
            <p class="dec">
              <a
                href="javascript:;"
                class="meiri"
              >每日歌曲推荐</a>
            </p>
            <p class="dec2">
              根据你的口味生成，
              <br>
              每天6:00更新
            </p>
          </div>
          <div
            class="TJmusic"
            v-for="item in selfTJ"
            :key="item.id"
          >
            <div class="photo">
              <img
                :src="item.coverImgUrl"
                alt=""
              >
              <!-- 跳转到歌曲详情的地方 -->
              <a href="javascript:;"></a>
            </div>
            <div class="buttom">
              <!-- 点击播放的链继 -->
              <a href="javascript:;"></a>
              <span class="erji"></span>
              <span class="shuliang">{{parseInt(item.playCount/10000)}}万</span>
            </div>
            <p class="butContent">
              <a href="javascript:;">{{item.name}}啊</a>
              <span>{{item.copywriter}}</span>
            </p>
          </div>

        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
 data: () => ({
   selfTJ:[],
   date:0,
   dateDay:"",
   Darr:["日","一","二","三","四","五","六"]
 }),
  created() {
    this.getselfTJ(),
    this.date=new Date().getDate(),
    this.dateDay=this.Darr[new Date().getDay()]
  },
  methods: {

    async getselfTJ(){
      try {
        const res=await this.Api.cyzApi.getselfTJ()
        //登录才有的
        // this.selfTJ=res.data.recommend.slice(0,3)
        //不登录也有
        this.selfTJ=res.data.playlists
      } catch (error) {
        alert("获取个性化推荐失败"+error)
      }
    }
  }
};
</script>
<style lang="less">
.selfdom{
  a{
    cursor: pointer;
    text-decoration: none;
  }
  .selfdomTao{
    .self{
      .v-hd2{
          width:88.5%;
      margin-left: 10px;
        height: 33px;
        padding: 0 10px 0 34px;
        border-bottom: 2px solid #C10D0C;
        position: relative;
        .yuanquan{
          float: left;
          position: absolute;
          left: -5px;
          width: 35px;
          height: 35px;
          background: url('../../../../assets/cyzimgs/xuebitu.png');
          background-position: -225px -156px;
        }
        .tit{
          position: absolute;
          left: 33px;
              float: left;
    font-size: 20px;
    font-weight: normal;
    line-height: 33px;
        }
      }
      .self-main{
        width: 729px;
        height: 270px;
        background: #fff;
        .dieSJ{
          margin: 20px 16px 0 38px;
          .zhengti{
                position: relative;
                zoom: 1;
                display: block;
                width: 140px;
                height: 140px;
                background-position: 0 0;
                .head{
                  display: block;
                  height: 33px;
                  line-height: 33px;
                  color: #fed9d9;
                  font-size: 14px;
                  text-shadow: 0 -1px #962626;
                  text-align: center;
                   background: url('../../../../assets/cyzimgs/xuebitu4.png');
                    background-position: 0 0px;
                }
                .bd{
                    display: block;
                    line-height: 102px;
                    text-align: center;
                    font-size: 94px;
                    font-family: Arial, Helvetica, sans-serif;
                    font-weight: bold;
                    color: #202020;
                }
                .wu{
                    position: absolute;
                    top: 33px;
                    left: 0;
                    width: 140px;
                    height: 107px;
                    background: url('../../../../assets/cyzimgs/xuebitu4.png');
                    background-position: 0 -150px;
                }
          }
          .dec{
            margin: 8px 0 3px;
            font-size: 14px;
            width: 100%;
            .meiri{
                  height: auto;
                  max-height: 36px;
                  _height: 36px;
                  overflow: hidden;
                      display: inline-block;
                  max-width: 100%;
                  _width: 100%;
                  vertical-align: middle;
                  color: #000;
                  font-size: 14px;
            }
          }
          .dec2{  
            margin-top: 3px;
            position: relative;
            z-index: 2;
            width: 100%;
            color: #999;
            font-size: 12px;
          }
        }

        .TJmusic{
  margin: 20px 15px 0 15px;
  width: 140px;
    height: 204px;
    float: left;
    display: inline-block;
    overflow: hidden;
    // padding-left: 42px;
    // padding: 0 0 30px 50px;
    line-height: 1.4;
    position: relative;
    .photo{
          width: 140px;
          height: 140px;
              position: relative;
    display: block;
    line-height: 1.4;
    img{
          display: block;
    width: 100%;
    height: 100%;
        border: 0;
    }
    a{
      background-position: 0 0;
      position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../../../../assets/cyzimgs/xuebitu2.png') no-repeat
    }
    }
  }
  .buttom{
    position: absolute;
    top: 115px;
    left: 0px;
    width: 100%;
    height: 27px;
    color: #ccc;
    background: url('../../../../assets/cyzimgs/xuebitu2.png')
     no-repeat;
    background-position: 0px -538px;;

    display: block;
    a{
          position: absolute;
    right: 10px;
    bottom: 5px;
    width: 16px;
    height: 17px;
        display: inline-block;
    background: url('../../../../assets/cyzimgs/xuebitu3.png') 
    no-repeat;
    background-position: 0 0;
    float: right;
    }
    .erji{
      position: absolute;
      top:-1px;
    width: 14px;
    height: 11px;
    margin: 9px 5px 9px 10px;
        display: inline-block;
    background: url('../../../../assets/cyzimgs/xuebitu3.png') no-repeat;
    background-position: 0 -23px;
        color: #ccc;
    }
    .shuliang{
      color:#ccc;
      position: absolute;
      left: 28px;
      top: 6px;
      font-size: 12px;
    }
  }
  .butContent{
        margin: 8px 0 3px;
    font-size: 14px;
        width: 100%;
        a{
          display: inline-block;
    max-width: 100%;
    color: #000;
    vertical-align: middle;
        }
        a:hover{
          text-decoration: underline;
        }
        span{
              color: #999;
              font-size: 12px;
        }
  }
      }
    }
  }
}
</style>